home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Demo
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Caption = "MultiText v1.30 Demo"
- ClientHeight = 4005
- ClientLeft = 510
- ClientTop = 1350
- ClientWidth = 8790
- Height = 4695
- Icon = DEMO.FRX:0000
- Left = 450
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 4005
- ScaleWidth = 8790
- Top = 720
- Width = 8910
- Begin OptionButton Option3
- Caption = "Auto"
- Height = 255
- Left = 5640
- TabIndex = 6
- Top = 3600
- Width = 975
- End
- Begin OptionButton Option2
- Caption = "Off"
- Height = 255
- Left = 4920
- TabIndex = 7
- Top = 3600
- Width = 615
- End
- Begin OptionButton Option1
- Caption = "On"
- Height = 255
- Left = 4200
- TabIndex = 8
- Top = 3600
- Value = -1 'True
- Width = 615
- End
- Begin CommandButton Command2
- Caption = "Load RTF"
- Height = 285
- Left = 5280
- TabIndex = 5
- Top = 3120
- Width = 1095
- End
- Begin CommandButton Command1
- Caption = "Load"
- Height = 285
- Left = 4560
- TabIndex = 4
- Top = 3120
- Width = 615
- End
- Begin TextBox Text1
- Height = 285
- Left = 1200
- TabIndex = 2
- Top = 3120
- Width = 3135
- End
- Begin SBMultiText MultiText1
- AutoPaint = -1 'True
- AutoScrollbar = 0 'False
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- DefArial = ""
- DefCourier = ""
- DefCourierNew = ""
- DefFixedSys = ""
- DefModern = ""
- DefMSSansSerif = ""
- DefMSSerif = ""
- DefRoman = ""
- DefScript = ""
- DefSmallFonts = ""
- DefSymbol = ""
- DefSystem = ""
- DefTerminal = ""
- DefTimesNewRoman= ""
- DefWingDings = ""
- FontName = 4 'MS Sans Serif
- FontSize = 22
- ForeColor0 = &H00000000&
- ForeColor1 = &H000000FF&
- ForeColor2 = &H00FF0000&
- ForeColor3 = &H0000FF00&
- ForeColor4 = &H00FF00FF&
- ForeColor5 = &H00FFFF00&
- ForeColor6 = &H0000FFFF&
- ForeColor7 = &H00808080&
- ForeColor8 = &H00008000&
- ForeColor9 = &H00FFFFFF&
- Height = 2775
- Highlight = &H8000000D&
- HilightEnabled = 0 'False
- HiTextColor = &H8000000E&
- IndentLeft = 4
- IndentRight = 4
- Left = 120
- LoadLength = 0
- LoadStart = 0
- Scrollbar = -1 'True
- SpecialChar = 91
- TabIndex = 1
- TableGap = 20
- TabWidth = 30
- Text = ""
- Top = 120
- UserFont = ""
- Width = 8055
- End
- Begin CheckBox Check1
- Caption = "Enable text selection"
- Height = 255
- Left = 240
- TabIndex = 0
- Top = 3600
- Width = 2415
- End
- Begin Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Scroll Bar :"
- Height = 195
- Left = 3120
- TabIndex = 9
- Top = 3630
- Width = 960
- End
- Begin Label Label1
- AutoSize = -1 'True
- Caption = "Filename : "
- Height = 195
- Left = 240
- TabIndex = 3
- Top = 3120
- Width = 945
- End
- Begin Image Image2
- Height = 480
- Left = 8280
- Picture = DEMO.FRX:0302
- Top = 1200
- Width = 480
- End
- Begin Image Image1
- Height = 480
- Left = 8280
- Picture = DEMO.FRX:0604
- Top = 600
- Width = 480
- End
- Begin Menu mnuFile
- Caption = "&File"
- Begin Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin Menu mnuEdit
- Caption = "&Edit"
- Begin Menu mnuCopy
- Caption = "&Copy"
- End
- Begin Menu mnuCopyFormat
- Caption = "C&opy format"
- End
- End
- Option Explicit
- ' (c) 1995 Steve Bannister
- ' s.bannister@pobox.com
- Dim t$
- Sub Check1_Click ()
- ' Allow/Dis-allow user to select regions of text
- If Check1.Value = 1 Then
- multitext1.HilightEnabled = True
- Else
- multitext1.HilightEnabled = False
- End If
- End Sub
- Sub Command1_Click ()
- On Error GoTo errlabel
- multitext1.LoadFile = text1.Text
- Exit Sub
- errlabel:
- Err = 0
- MsgBox "Error loading file"
- Exit Sub
- End Sub
- Sub Command2_Click ()
- On Error GoTo errlabel2
- multitext1.ImportRTF = text1.Text
- Exit Sub
- errlabel2:
- Err = 0
- MsgBox "Error loading file"
- Exit Sub
- End Sub
- Sub Form_Load ()
- Dim c$
- c$ = Chr$(10)
- t$ = "[AWelcome to [tMultiText[A, a versatile non-editable text box capable of "
- t$ = t$ & "displaying text using different [Cfonts[A and with "
- t$ = t$ & "a variety of font [I[Uattributes[u[i." & c$ & c$
- t$ = t$ & "You may even import and display [1RTF[0 text !" & c$ & c$
- t$ = t$ & "Multiple [1colors [2can [3also [4be [5used [0but don't get "
- t$ = t$ & "carried away !" & c$ & c$
- t$ = t$ & "Text may also contain [8[ghyperlinks[cFirstTag[0 which [8[gwill[cSecondTag[0 cause an "
- t$ = t$ & "event to occur when [g[8clicked[0[cThirdTag upon. New for v1.30 are tag words which can be associated "
- t$ = t$ & "with each hyperlink." & c$ & c$
- t$ = t$ & "Text may be selected, and copied to the clipboard. To "
- t$ = t$ & "demonstrate, [Bcheck[b the box below, [Bselect[b some text "
- t$ = t$ & "with the cursor, then select [BCopy[b from the [BEdit[b "
- t$ = t$ & "menu above. Load [BClipboard Viewer[b and check out the "
- t$ = t$ & "results." & c$ & c$
- t$ = t$ & "[DSuperscript[d and [Gsubscript[d text can be included, as "
- t$ = t$ & "can fractions, for example [BVolume of sphere V[Gs[d = [f4/3[Yp[Ar[D3[d[b" & c$ & c$
- t$ = t$ & "Scrolling methods are included, for use with, say, a "
- t$ = t$ & "custom scrollbar. Press the arrow buttons on the "
- t$ = t$ & "right side of this form." & c$ & c$
- t$ = t$ & "Text may also be loaded direct from file. To try this "
- t$ = t$ & "out enter a filename below and press [BLoad[b." & c$ & c$
- t$ = t$ & "New for version 1.30 are support" & Chr$(9) & "for" & Chr$(9) & "tabs, "
- t$ = t$ & "redefinable fonts allowing up to 16 user-defined fonts available in "
- t$ = t$ & "a single document. Also new is table handling, with automatic column "
- t$ = t$ & "sizing, for example :" & c$ & c$
- t$ = t$ & "[UState[hCapital[hNickname[u" & c$
- t$ = t$ & "California[hSacramento[hGolden State" & c$
- t$ = t$ & "New York[hAlbany[hEmpire State" & c$
- t$ = t$ & "Washington[hOlympia[hEvergreen State"
- multitext1.Text = t$
- left = (screen.Width - Width) \ 2
- End Sub
- Sub Image1_Click ()
- ' Scroll Up
- multitext1.ScrollUp = True
- End Sub
- Sub Image2_Click ()
- ' Scroll Down
- multitext1.ScrollDown = True
- End Sub
- Sub mnuCopy_Click ()
- multitext1.Copy = True
- End Sub
- Sub mnuCopyFormat_Click ()
- multitext1.CopyFormat = True
- End Sub
- Sub mnuExit_Click ()
- End
- End Sub
- Sub MultiText1_Hot (HotIndex As Integer, HotWord As String)
- Dim ht$
- ht$ = multitext1.HotTag
- MsgBox "You pressed '" & HotWord & "' (" & ht & ")"
- End Sub
- Sub Option1_Click ()
- multitext1.AutoScrollbar = False
- multitext1.Scrollbar = True
- End Sub
- Sub Option2_Click ()
- multitext1.AutoScrollbar = False
- multitext1.Scrollbar = False
- End Sub
- Sub Option3_Click ()
- multitext1.AutoScrollbar = True
- End Sub
-